//
//  SalaryQuaryAPIManger.m
//  FindJob
//
//  Created by 233 on 16/3/7.
//  Copyright © 2016年 Lee. All rights reserved.
//

#import "SalaryQuaryAPIManger.h"
#import "NetWorkingConfig.h"
@implementation SalaryQuaryAPIManger

- (void)startSalaryQuaryRequestWithPaprameters:(NSDictionary *)parameter responds:(void (^)(RespondsStatus, NSString *, id))respondsBlock{
    [self startRequestURL:kSalaryQuaryURL parameters:parameter success:^(id responds) {
        NSInteger resultCode = [responds[@"resultCode"] integerValue];
        NSString *resultDesc = responds[@"resultDesc"];
        if (resultCode == 0) {
            NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
            [dict setObject:responds[@"maxSalary"] forKey:@"maxSalary" ];
            [dict setObject:responds[@"minSalary"] forKey:@"minSalary" ];
            if (respondsBlock) {
                respondsBlock(RespondsStatusSuccess,resultDesc,dict);
            }else{
                if (respondsBlock) {
                    respondsBlock(RespondsStatusDataError,resultDesc,nil);
                }
            }
        }
    } failure:^(NSError *error) {
        if (respondsBlock) {
            respondsBlock(RespondsStatusNotworkingError,@"网络错误",nil);
        }

    } timeout:30];
}
@end
